Manually add SIP Contact header for calls when using Sofia >= 1.13 (fixes #2439, replaces #2597) #2708
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Apparently, newer versions of Sofia SIP as maintained by Freeswitch (>= 1.13) don't add a Contact header anymore for calls that are not associated with a previous registration: this is explained in #2439. A first patch was contributed in #2597, which IMHO was a bit too complex. This PR tries to address it in a "simpler" way.
First of all, we check the Sofia SIP version at startup: if it's 1.12.x or older, we do nothing at all (as the Contact header is always there for me). Otherwise, rather than invoking
nua_get_params
at every call as #2597 did, we only do it once when creating the stack. Then, we conditionally add the Contact header only for guest calls, and not all of them as the original PR did.Not sure if we should do the same for other requests as well (e.g., INFO, MESSAGE, etc.), or if my assumption that only guest users are impacted is correct. I don't have 1.13.x installed so I can't test myself: if you care about this, please test in different conditions (including, if possible, helper sessions) and let us know if this addresses the issue.